<template>
  <div>
    <div
      v-for="(item, index) in arr"
      :key="index"
      style="display: inline-block"
    >
      <input type="checkbox" v-model="hobby" :value="item" /><span>{{
        item
      }}</span>
      <!-- <input type="checkbox" v-model="hobby" value="喜剧" /><span>喜剧</span>
      <input type="checkbox" v-model="hobby" value="动漫" /><span>动漫</span>
      <input type="checkbox" v-model="hobby" value="冒险" /><span>冒险</span>
      <input type="checkbox" v-model="hobby" value="科技" /><span>科技</span>
      <input type="checkbox" v-model="hobby" value="军事" /><span>军事</span>
      <input type="checkbox" v-model="hobby" value="娱乐" /><span>娱乐</span>
      <input type="checkbox" v-model="hobby" value="奇闻" /><span>奇闻</span> -->
    </div>

    <ul>
      <li v-for="item in hobby" :key="item">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
      hobby: [],
    };
  },
};
</script>

<style>
</style>